<script type="text/javascript">
function saverole_menu(){
	var zTree = $.fn.zTree.getZTreeObj("treeroleid")
    var menus = zTree.getNodes();
	$("#treeroleid").bjuiajax('doAjax', {url:"${ctx}/role/roleMenuSave",confirmMsg:"是否确定需要保存？",data:{'menus':JSON.stringify(menus[0]),'roleid':"${roleid}"}});
}
</script>
<%
   if (rolemenus != null && rolemenus.~size > 0){
%>
<button class="btn btn-green" onclick="saverole_menu();">保存菜单权限</button>
<ul id="treeroleid" class="ztree" data-toggle="ztree" data-max-add-level="3" data-expand-level="3"
	data-expand-all="true" data-check-enable="true">
	<li data-id="-1" data-faicon="home">菜单</li>
      <%
         for (smenu in rolemenus){
      %>
      	<li data-id="${smenu.id!}" data-pid="${smenu.pid!}" data-text="${smenu.text!}" data-seq="${smenu.seq!}" data-url="${smenu.url!}" data-faicon="${smenu.icon!}" data-checked="${smenu.checked!}">${smenu.text!}</li>
      <%
         if (smenu.smenus != null && smenu.smenus.~size > 0){
          for (menu in smenu.smenus){
      %>
          <li data-id="${menu.id!}" data-pid="${menu.pid!}" data-text="${menu.text!}" data-seq="${menu.seq!}" data-url="${menu.url!}" data-faicon="${menu.icon!}" data-checked="${menu.checked!}">${menu.text!}</li>
      <%
        if (menu.smenus != null && menu.smenus.~size > 0){
          for (cmenu in menu.smenus){
      %>
         <li data-id="${cmenu.id!}" data-pid="${cmenu.pid!}" data-text="${cmenu.text!}" data-seq="${cmenu.seq!}" data-url="${cmenu.url!}" data-faicon="${cmenu.icon!}" data-checked="${cmenu.checked!}">${cmenu.text!}</li> 
      <%
         }
        }
      %>
      <%
         }
        }
      %>
      <%
         }
      %>
</ul>
<%
  }else{
%>
单击表格行显示数据
<%
  }
%>